package cn.bocweb.spinning.view.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import cn.bocweb.spinning.view.fragment.CompanyCertiFragment;
import cn.bocweb.spinning.view.fragment.CompanyContactFragment;
import cn.bocweb.spinning.view.fragment.CompanyIntroFragment;

/**
 * Created by chenchangxing on 15/12/17.
 */
public class CompanyInfoAdapter extends FragmentPagerAdapter {

    String id;

    public CompanyInfoAdapter(FragmentManager fm, String id) {
        super(fm);
        this.id = id;
    }

    @Override
    public Fragment getItem(int position) {
        switch (position) {
            case 0: {
                return new CompanyIntroFragment(id);
            }
            case 1: {
                return new CompanyCertiFragment(id);
            }
            case 2: {
                return new CompanyContactFragment(id);
            }
        }
        return null;
    }

    @Override
    public int getCount() {
        return 3;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        switch (position) {
            case 0: {
                return "企业介绍";
            }
            case 1: {
                return "认证信息";
            }
            case 2: {
                return "联系方式";
            }
        }
        return "";
    }
}
